<template>
    <div>
        <ul class="mui-table-view mui-table-view-chevron">
			<li class="mui-table-view-cell mui-media" v-for="item in newslist" :key='item.id'>
				<router-link class="mui-navigate-right" :to="'/home/newsinfo/'+ item.id">
					<img class="mui-media-object mui-pull-left" :src="item.img_url">
					<div class="mui-media-body">
						<h1>{{ item.title }}</h1>
						<p class='mui-ellipsis'>
                            <span>发表时间：{{ item.add_time }}</span>
                            <span>点击次数：{{  item.click }}</span>
                        </p>
					</div>
				</router-link>
			</li>
		</ul>
    </div>
</template>

<script>
import { Toast } from 'mint-ui'

export default {
    data(){
        return {
            newslist:[
                {
                    add_time:'2019-1-03 12:11:00',
                    click: 3 ,
                    id:1,
                    img_url:require('../../images/cbd.jpg'),
                    title:'CBD'
                },
                {
                    add_time:'2019-1-11 10:30:00',
                    click: 10 ,
                    id:2,
                    img_url:require('../../images/yuantiao.jpg'),
                    title:'远眺'
                },
                {
                    add_time:'2019-1-31 12:11:00',
                    click: 7,
                    id:3,
                    img_url:require('../../images/shuijiao.jpg'),
                    title:'幸福'
                },
                {
                    add_time:'2019-1-03 12:11:00',
                    click: 3 ,
                    id:4,
                    img_url:require('../../images/cbd.jpg'),
                    title:'CBD'
                },
                {
                    add_time:'2019-1-03 12:11:00',
                    click: 3 ,
                    id:5,
                    img_url:require('../../images/cbd.jpg'),
                    title:'CBD'
                },
                {
                    add_time:'2019-1-03 12:11:00',
                    click: 3 ,
                    id:6,
                    img_url:require('../../images/cbd.jpg'),
                    title:'CBD' 
                },
                {
                    add_time:'2019-1-03 12:11:00',
                    click: 3 ,
                    id:7,
                    img_url:require('../../images/cbd.jpg'),
                    title:'CBD'
                },
                {
                    add_time:'2019-1-03 12:11:00',
                    click: 3 ,
                    id:8,
                    img_url:require('../../images/cbd.jpg'),
                    title:'CBD'
                },
                {
                    add_time:'2019-1-03 12:11:00',
                    click: 3 ,
                    id:9,
                    img_url:require('../../images/cbd.jpg'),
                    title:'CBD'
                }
            ]
        }
    },
    created(){
        // this.getNewsList();
    },
    methods:{
        // getNewsList(){
        //     this.$http.get().then(result => {
        //         if(result.body.status === 0){
        //             this.newslist = result.body.message;
        //         }else{ 
        //             Toast('获取商品列表失败')
        //         }
        //     })
        // }
    }
    
}
</script>

<style lang="scss" scoped>
.mui-table-view{
    li{
        h1{ font-size: 15px;}
    }

    .mui-ellipsis{
        font-size: 10px;
        display: flex;
        justify-content: space-between;
    }

}

</style>
